#include <string>
#include <clocale>
#include <iostream>
#include <string>
#include "Vehicle.h"
#include "VehicleRegister.h"

using namespace std;


void main3_1_2()
{
	cout << "Uppgift 1-2" << endl;
	Vehicle v1;
	Vehicle v2("Volvo", 1997, 20000.4, 12000.2);

	//v1.Read();
	v1.Write();
	v2.Write();
}

void main3_3()
{
	cout << "Uppgift 3" << endl;
	Vehicle v1;
	Vehicle v2("Saab", 1778, 15, 30);

	cout << "Vehicle 1" << endl << v1 << endl;
	cout << "Vehicle 2" << endl << v2 << endl;
	cout << "Write data about vehicle, start and finish with a parantesis." << endl << "Separate data with comma. Example: (Mazda, 1990, 2000, 1500)" << endl;
	cin >> v1;

	cout << "Vehicle 1" << endl << v1 << endl;
}

void main3_4_5()
{
	cout << "Uppgift 4-5" << endl;
	Vehicle v1("Volvo", 1997, 20000, 12000);
	Vehicle v2("Saab", 1778, 15, 30);
	Vehicle v3("Ferrari", 2004, 150000, 5000);
	Vehicle v4("Porsche", 1097, 1, 200000);
	VehicleRegister vReg;

	vReg.Add(v1);
	vReg.Add(v2);
	vReg.Add(v3);
	vReg.Add(v4);

	vReg.setDealer("AutoBot");

	cout << vReg.getDealer() << endl << vReg.List() << endl;

	vReg.Delete(2);

	cout << vReg.getDealer() << endl << vReg.List() << endl;

	vReg.WriteToFile();
}

void main3_6()
{
	cout << "Uppgift 6" << endl;
	VehicleRegister vReg;
	
	vReg.ReadFromFile();

	cout << vReg.getDealer() << endl;

	cout << vReg.List() << endl;
	cout << vReg.CalculateStorageValue();
	
}
int main()
{
	main3_1_2();
	cout << endl;
	//main3_3();
	cout << endl;
	main3_4_5();
	cout << endl;
	main3_6();
	cout << endl;
	system("PAUSE");
	return 0;
}